﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using System.Windows.Data;
using edem2simpack.Models;

namespace edem2simpack.Models.CosimulationValueConverter
{   

    public class OrientationValueConverter : IValueConverter
    {
        private object tempValue = null;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            tempValue = value;
            ModelVariable ModelValue = new ModelVariable();
            if (value is not null)
            {
                ModelValue.Name = "test";
                ModelValue.ValueReference = 1;               
            }
            return ModelValue;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        { 
            if (tempValue is not null)
            {
                return tempValue;
            }
            return tempValue;
        }
    }

    public class ForceValueConverter : IValueConverter
    {
        private object tempValue = null;
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            tempValue = value;
            ModelVariable ModelValue = new ModelVariable();
            if (value is not null)
            {
                ModelValue.Name = "test";
                ModelValue.ValueReference = 1;
            }
            return ModelValue;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (tempValue is not null)
            {
                return tempValue;
            }
            return tempValue;
        }
    }




}
